home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / network / ncsasock / s_fcntl.h < prev    next >
Text File  |  1996-07-05  |  4KB  |  111 lines

  1. /*-
  2.  * Copyright (c) 1983, 1990 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution is only permitted until one year after the first shipment
  6.  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
  7.  * binary forms are permitted provided that: (1) source distributions retain
  8.  * this entire copyright notice and comment, and (2) distributions including
  9.  * binaries display the following acknowledgement:  This product includes
  10.  * software developed by the University of California, Berkeley and its
  11.  * contributors'' in the documentation or other materials provided with the
  12.  * distribution and in all advertising materials mentioning features or use
  13.  * of this software.  Neither the name of the University nor the names of
  14.  * its contributors may be used to endorse or promote products derived from
  15.  * this software without specific prior written permission.
  16.  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19.  *
  20.  *    @(#)fcntl.h    5.5 (Berkeley) 5/29/90
  21.  */
  22.  
  23. #ifndef F_DUPFD
  24.  
  25. /* command values for fcntl(2) */
  26. #define    F_DUPFD        0        /* duplicate file descriptor */
  27. #define    F_GETFD        1        /* get file descriptor flags */
  28. #define    F_SETFD        2        /* set file descriptor flags */
  29. #define    F_GETFL        3        /* get file status flags */
  30. #define    F_SETFL        4        /* set file status flags */
  31. #ifndef _POSIX_SOURCE
  32. #define    F_GETOWN    5        /* get SIGIO/SIGURG proc/pgrp */
  33. #define F_SETOWN    6        /* set SIGIO/SIGURG proc/pgrp */
  34. #endif
  35. #define    F_GETLK        7        /* get record locking information */
  36. #define    F_SETLK        8        /* set record locking information */
  37. #define    F_SETLKW    9        /* F_SETLK; wait if blocked */
  38.  
  39. /* file descriptor flags (F_GETFD, F_SETFD) */
  40. #define    FD_CLOEXEC    1        /* close-on-exec flag */
  41.  
  42. /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
  43. #define    F_RDLCK        1        /* shared or read lock */
  44. #define    F_UNLCK        2        /* unlock */
  45. #define    F_WRLCK        3        /* exclusive or write lock */
  46.  
  47. #ifndef _POSIX_SOURCE
  48. /* lock operations for flock(2) */
  49. #define    LOCK_SH        0x01        /* shared file lock */
  50. #define    LOCK_EX        0x02        /* exclusive file lock */
  51. #define    LOCK_NB        0x04        /* don't block when locking */
  52. #define    LOCK_UN        0x08        /* unlock file */
  53. #endif
  54.  
  55. #if !defined(COMP_THINKC)
  56. /* file status flags */
  57. #define    O_RDONLY    00000        /* open for reading only */
  58. #define    O_WRONLY    00001        /* open for writing only */
  59. #define    O_RDWR        00002        /* open for reading and writing */
  60. #define    O_NONBLOCK    00004        /* no delay */
  61. #endif /* !COMP_THINKC */
  62. #ifndef _POSIX_SOURCE
  63. #if !defined(COMP_THINKC)
  64. #define    O_NDELAY    O_NONBLOCK
  65. #endif /* !COMP_THINKC */
  66. #define    FNDELAY        O_NONBLOCK
  67. #endif
  68. /*            00008        /* unused */
  69. #if  !defined(COMP_THINKC)  && !defined(__MWERKS__)
  70. #define    O_APPEND    00010        /* set append mode */
  71. #ifndef _POSIX_SOURCE
  72. #define    FAPPEND        O_APPEND
  73. #endif
  74.                     /* kernel placeholders */
  75. #if !defined(_POSIX_SOURCE) && defined(KERNEL)
  76. #define    O_MARK        00020        /* mark during gc() */
  77. #define    O_DEFER        00040        /* defer for next gc pass */
  78. #endif
  79. /*            00080        /* unused */
  80. #ifndef _POSIX_SOURCE
  81. #define    O_ASYNC        00100        /* signal pgrp when data ready */
  82. #define    FASYNC        O_ASYNC
  83. #define    O_SHLOCK    00200        /* shared file lock present */
  84. #define    O_EXLOCK    00400        /* exclusive file lock present */
  85. /*            00800        /* unused */
  86. #endif
  87. #define    O_CREAT        01000        /* create if nonexistant */
  88. #define    O_TRUNC        02000        /* truncate to zero length */
  89. #define    O_EXCL        04000        /* error if already exists */
  90. /*            08000        /* unused */
  91.  
  92. /* defined by POSIX 1003.1; BSD default, so no bit required */
  93. #define    O_NOCTTY    0        /* don't assign controlling terminal */
  94.  
  95. /* mask for file access modes */
  96. #define    O_ACCMODE    (O_RDONLY|O_WRONLY|O_RDWR)
  97.  
  98. #if __STDC__ || c_plusplus
  99. extern int fcntl(int, int, int);
  100. extern int creat(const char *, mode_t);
  101. extern int open(const char *, int, ...);
  102. #else
  103. extern int fcntl();
  104. extern int creat();
  105. extern int open();
  106. #endif
  107.  
  108. #endif /* !COMP_THINKC */
  109.  
  110. #endif /* !F_DUPFD */
  111.